#include <iostream>

using namespace std;
typedef long long LL; 
LL sum;

int main()
{
	int n; cin >> n;
	int l = 1, r = 1;
	int m = (n + 1) / 2;
	while(r <= m + 1)
	{
		
		sum += r;
		r++;
		while(sum > n) 
		{
			sum -= l;
			l++;
		}
		if(sum == n) cout << l << " " << r - 1 << endl;
	}
	
	return 0;
}
